﻿<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/UserHome.Master" CodeBehind="Details.aspx.vb" Inherits="LEAD.Details" 
    title="Untitled Page" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <tr>
    <td>
        <div id="fb-root"></div>
<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript">
  FB.init({
    appId  : 'YOUR APP ID',
    status : true, // check login status
    cookie : true, // enable cookies to allow the server to access the session
    xfbml  : true  // parse XFBML
  });
</script>

    <form id="form1" runat="server">
    
    
                <tr>
        <td>
        <table style="width: 100%">
                <tr>
                    <td align="center"  style="background-color: Maroon; color:white "  >
                        <h3>&nbsp; You are <asp:Label ID="lblCount"  CssClass="Visitor" runat="server" Text="Label"></asp:Label>TH Visitor</h3>
                        </td>
                 </tr>
                 <%--<tr>
                        <td>
                         <%
                            ID = GetCurrentPageName() 
                         %>
                        <iframe src="http://www.facebook.com/plugins/like.php?href=<%=ID %>&amp;layout=button_count&amp;show_faces=false&amp;width=450&amp;action=like&amp;font=tahoma&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:21px;" allowTransparency="true"></iframe>
                       <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="" layout="button_count" show_faces="true" width="450" font=""></fb:like>
                      </td>
                        <td>
                        <a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="http://leadherts.codeplex.com/">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
                        </td>
                </tr>--%>
                
                <tr>
                
                <div style="float:right; width:200px !important; margin-top:0; _overflow:hidden; *padding-top:5px; *padding-bottom:0;">
   <table cellspacing="0" cellpadding="0" border="0" align="right" width="200" style="float:right;">
    <tbody><tr><td valign="top">

<table border="0" cellspacing="0" cellpadding="0" align="right" width="200" style="#margin-left:-150px;_margin:0px;">
  <tbody><tr>
    <td align="right" width="200">
      <table border="0" cellspacing="0" cellpadding="0" align="right" height="13">
<tbody><tr>
<td style="vertical-align:bottom;">
<span style="margin-right:3px">
<div  style="float: right; margin-left: 0.75em;">

 <a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="http://leadherts.codeplex.com/">Tweet</a>
 
  <script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>
                         <%
                            ID = GetCurrentPageName() 
                         %>
</span></td>
		<td style="padding-left:0px; vertical-align:bottom;">
		<fb:like style="float:right; padding-top:1px; height:20px;" width="80" height="20" show_faces="false" 
		href="<%=ID %>" layout="button_count" 
		class="fb_like fb_edge_widget_with_comment fb_iframe_widget">
</fb:like></td>

<td > Text Size</td>
<td>	
<a>
<img src="/images/txt_minus.gif" alt="Decrease font" onclick="" title="Decrease font" style="padding-top:6px;"/></a></td>
 <td><%--<a href="javascript:$.cbz.effects.news.increaseFont();">--%>
 <img src="/images/txt_plus.gif" alt="Enlarge font" title="Enlarge font" style="padding-top:6px;"/></a>
				</td>

       </tr>
  </tbody></table></td>
  </tr>
  
</tbody></table>
    </td></tr>
    </tbody></table>
	</div>
                
                </tr>
                <tr>
                    <td align="center">
                        
                              <%--BINDING--%>
 <table width="100%">

<tr>
<td height="10px" colspan="2" align="right" >

                        Average rating is
                        <asp:Label ID="lblRating_avg" runat="server" Text="0"></asp:Label>
&nbsp;from
                        <asp:Label ID="lblRating_users" runat="server" Text="0"></asp:Label>
&nbsp;users

                        <asp:Rating ID="Avg_Rating" runat="server" RatingAlign="Horizontal"  
                            RatingDirection="LeftToRightTopToBottom"   ReadOnly="true"
        BorderWidth="0"  BorderStyle="Solid" width="200" Height="40" CurrentRating="0" StarCssClass="ratingStar" 
                            WaitingStarCssClass="savedRatingStar" 
        EmptyStarCssClass="emptyRatingStar" filledStarCssClass="filledRatingStar" 
        MaxRating="5" >
         </asp:Rating>
        </td>
        <td>
                       
    <asp:Chart ID="Chart1" runat="server" DataSourceID="SqlDataSource5" Height="150px" Width="198px">
        <Series>
            <asp:Series Name="Series1" XValueMember="Useridentity" YValueMembers="score">
            </asp:Series>
        </Series>
        <ChartAreas>
            <asp:ChartArea Name="ChartArea1">
            </asp:ChartArea>
        </ChartAreas>
    </asp:Chart>

                        
                        <br />
            Graph showing users ratings<asp:SqlDataSource ID="SqlDataSource5" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
                            
                SelectCommand="SELECT [score], [Useridentity] FROM [Ratings1] WHERE ([actionid_FK] = ?)">
                <SelectParameters>
                    <asp:QueryStringParameter Name="actionid_FK" QueryStringField="ActionID" 
                        Type="Int32" />
                </SelectParameters>
            </asp:SqlDataSource>

                        
</td>
</tr>
   
   
   <tr>
   <td style="width: 350px">
   <table align="left">
   <tr>
   <td  style="height:350px; width:350px">
   <asp:Image ID="image" runat="server"  ImageAlign="Top" Height="350px" Width="350px" />
   </td>
   </tr>
   <tr>
   <td style="width: 350px">
   <asp:Label ID="lblimagecaption" runat="server" CssClass="Msgbody"></asp:Label>
   </td>
   </tr>
   <tr>
   <td style='border: thick solid gray; background-color:Silver; text-align:center;'>
       <asp:Label ID="lblEmail" runat="server" ForeColor="#0066CC" Text="Email sent" 
           Visible="False"></asp:Label>
       <br />
       Email this to your friend
   Enter Email id
       <asp:TextBox ID="txtemail" runat="server" Width="200px"></asp:TextBox>
       <br />
       <asp:Label ID="lblemailerror" runat="server" ForeColor="#CC0000" 
           Text="eMail cant be empty" Visible="False"></asp:Label>
       <br />
       <asp:Label ID="Label1" runat="server" Text="Say something about this article"></asp:Label>
       <asp:TextBox ID="TextBox1" runat="server" Height="46px" TextMode="MultiLine" 
           Width="282px"></asp:TextBox>
       <br />
       <asp:Button ID="BtnEmail" runat="server" Text="Send eMail" />
       </td>
   </tr>
   <tr>
   <td style='border: thick solid gray; text-align:center;'>
       <asp:GridView ID="gvSameAuthor" runat="server" AutoGenerateColumns="False" 
           DataSourceID="SqlDSsameAuthor" GridLines="None">
           <Columns>
        <asp:HyperLinkField DataNavigateUrlFields="ActionID" 
                DataNavigateUrlFormatString="Details.aspx?ActionID={0}" 
                DataTextField="Title" HeaderText="Other Articles from this author" 
                SortExpression="Title" >
                <ControlStyle Width="200px" />
                <HeaderStyle Width="200px" />
                <ItemStyle HorizontalAlign="Center" />
            </asp:HyperLinkField>
               <asp:BoundField DataField="Count_page" HeaderText="Visits" 
                   SortExpression="Count_page" />
           </Columns>
       </asp:GridView>
       <asp:SqlDataSource ID="SqlDSsameAuthor" runat="server" 
           ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
           ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
           
           SelectCommand="SELECT Title, ActionID, AddedDate, Count_page FROM MasterTable WHERE UserID_FK IN ( SELECT UserID_FK FROM [MasterTable] WHERE ActionID=? ) AND ActionID <> ?">
           <SelectParameters>
               <asp:QueryStringParameter Name="ActionID" QueryStringField="ActionID" />
               <asp:QueryStringParameter Name="ActionID" QueryStringField="ActionID" />
               
           </SelectParameters>
       </asp:SqlDataSource>
   </td>
   </tr>
   </table>
   </td>
   
   <td style="vertical-align:top; padding:50px; width: 349px;">
   <table cellpadding="0" cellspacing="0" width="100%";">
   
    <tr>
   <td>
   <asp:Label ID="lbltitle" runat="server" Font-Size="20px" CssClass="TitleHeader"></asp:Label>
   </td>
   </tr>
   
   <tr>
   <td>
   <asp:Label ID="lbldescription" runat="server"  Font-Size="14px" CssClass="Msgbody"></asp:Label>
   </td>
   </tr>
   </table>
   </td>
   </tr>
   </table>
<%--   <asp:ScriptManager ID="ScriptManager1" runat="server" />
--%>                           
                        <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
                        </asp:ToolkitScriptManager>  
                        <table>
                    <tr>
                        <td>
                            <asp:CheckBoxList ID="chkTags" runat="server" 
                                DataSourceID="SqlDataSource3" DataTextField="TagName" 
                                DataValueField="TagID" RepeatDirection="Horizontal">
                            </asp:CheckBoxList>
                            <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
                                ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                                ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
                                SelectCommand="SELECT [TagID], [TagName] FROM [Tags] ORDER BY TagName"></asp:SqlDataSource>
                        </td>
                    </tr>
                    <tr>
                    <td>
                        <a>Add New Tag</a>
                        <asp:TextBox ID="txtNewTag" runat="server"></asp:TextBox>
                      </td>
                          <td>
                            <asp:Button ID="btnTags" runat="server" Text="Add Tag" />
                            <asp:Label ID="lblTagsuccess" runat="server" Visible="false" ForeColor="Red" Text="Tag Added Successfully"></asp:Label>                        
                        </td>
                    
                    </tr>
                    
                    
                </table>

                        <asp:Rating ID="Rating1" runat="server" RatingAlign="Horizontal"  
                            RatingDirection="LeftToRightTopToBottom"  BorderWidth="0"  BorderStyle="Solid" 
                                  width="200" Height="40" CurrentRating="0" StarCssClass="ratingStar" 
                            WaitingStarCssClass="savedRatingStar" EmptyStarCssClass="emptyRatingStar" 
                                  filledStarCssClass="filledRatingStar" MaxRating="5" >
                            
                        </asp:Rating>
                        
                        
                        <asp:Button ID="btnRating" runat="server" Text="Rate" />
                        
                        
                        <br />
                        <br />
                        
                        
                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
                            SelectCommand="SELECT * FROM [MasterTable] WHERE ([ActionID] = ?)">
                            <SelectParameters>
                                <asp:QueryStringParameter Name="ActionID" QueryStringField="ActionID" 
                                    Type="Int32" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                        

 




                        ADD YOUR COMMENT HERE&nbsp; <asp:LoginName ID="LoginName1" runat="server" />
                        <br />
                        TITLE  <asp:TextBox ID="tb_title" runat="server" Width="432px"></asp:TextBox>
                        <br />
                        <asp:TextBox ID="tb_comment" runat="server" Height="83px" TextMode="MultiLine" 
                            Width="481px"></asp:TextBox>
                        <br />
                        <asp:Button ID="btnComment" runat="server" Text="Submit" /><br /> <br />
                        <%--<asp:Repeater ID="Repeater1"  DataSourceID="SqlDataSource4" runat="server">
                        <HeaderTemplate>
                        
                        
                        </HeaderTemplate>
                        <ItemTemplate>
                <table width="60%">
                    <tr>
                        <td colspan="2" align="center">
                            <%#Eval("Title")%> : 
                         </td>
                    </tr>
                    <tr>
                        <td  align="left">
                            <%#Eval("author")%> :
                        </td>
                    </tr>
                    <tr>
                        <td align="left">
                            <%#Eval("comments")%></td>
                    </tr>
                </table> 
                
                </ItemTemplate>
                        </asp:Repeater>--%>
                        <asp:Repeater ID="Repeater1" DataSourceID="SqlDataSource4" runat="server">
                <HeaderTemplate>
                <a style="">WRITE YOUR COMMENTS HERE</a>
                </HeaderTemplate>
               <ItemTemplate>
                <table style="background-color:Silver; width:60%" >
                    <tr>
                        <td colspan="2" align="left" style="width:75%">
                           <a style=" color:Red; font-family:Calibri;">#<%# Container.ItemIndex + 1 %>:</a> <%#Eval("Title")%> 
                         </td>
                         
                        <td  align="right" style="width:25%; font-family:Calibri;">
                            <%#Eval("author")%> 
                        </td>
                    </tr>
                    
                </table>

                <table style="background-color:ButtonFace; width:60%">
                    <tr>
                        <td align="left" style=" font-family:Calibri;">
                            <%#Eval("comments")%></td>
                            
                        <td align="right" style=" font-family:Calibri;">
                            <asp:Image ID="Image1" ImageUrl="images/Users/DefaultImage.png" Width="75px" Height="75px" runat="server" />
                        </td>
                    </tr>
                    <tr>
                    <td align="left">
                        <asp:Button ID="Button1" runat="server" Text="Like" />
                    </td>
                    </tr>
                </table> 
                
                </ItemTemplate>
                <FooterTemplate>

                </FooterTemplate>
                </asp:Repeater>

                
                <asp:SqlDataSource ID="SqlDataSource4" runat="server"
                ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 

                SelectCommand="SELECT [author], [title], [comments] FROM [Postings] WHERE ([actionID] = ?)">
                    <SelectParameters>
                        <asp:QueryStringParameter Name="actionID" QueryStringField="ActionID" 
                            Type="Int32" />
                    </SelectParameters>
                              </asp:SqlDataSource>


                        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
                            SelectCommand="SELECT [Title], [author], [Comments]  FROM [Postings] WHERE ([actionID] =@actionid)">
                            <SelectParameters>
                                <asp:QueryStringParameter Name="action_IDFK" QueryStringField="Acion_ID" 
                                    Type="Int32" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                        <%--ADD YOUR COMMENT HERE&nbsp; <asp:LoginName ID="LoginName1" runat="server" />
                        <br />
                        TITLE  <asp:TextBox ID="tb_title" runat="server" Width="432px"></asp:TextBox>
                        <br />
                        <asp:TextBox ID="tb_comment" runat="server" Height="83px" TextMode="MultiLine" 
                            Width="481px"></asp:TextBox>
                        <br />
                        <asp:Button ID="btnComment" runat="server" Text="Submit" />--%>
                    </td>
                </tr>
            </table>
            </td>
    </tr>
    </form>
    </td>
</tr>
</asp:Content>
